//package com.inspur.edp.cef.variable.dtgenerator.vardtmGenerate.generatecmpcode;
//
//
//import com.inspur.edp.cef.designtime.api.operation.CommonOperation;
//
//public abstract class BaseCommonCompCodeGenerator implements IBaseCompCodeGen
//{
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//		///#region 字段
//	private String entityNamespace;
//	private String apiNamespace;
//	private IRefCommonService lcmDtService;
//	private IRefCommonService LcmDtService => (lcmDtService != null) ? lcmDtService : (lcmDtService = ServiceManager.<IRefCommonService>GetService());
//
//	protected CommonOperation Operation;
//	protected String NameSpace;
//	protected String EntityClassName;
//
//	protected abstract String getBaseClassName();
//	private String privatePath;
//	public final String getPath()
//	{
//		return privatePath;
//	}
//	public final void setPath(String value)
//	{
//		privatePath = value;
//	}
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//		///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//		///#region 构造函数
//	protected BaseCommonCompCodeGenerator(CommonVariableEntity udtDef, CommonOperation operation, String nameSpace, String path)
//	{
//		setPath(path);
//		Operation = operation;
//		NameSpace = GetNameSpace(nameSpace);
//		EntityClassName = udtDef.GetGeneratedEntityClassInfo().ClassName;
//		entityNamespace = udtDef.GetGeneratedEntityClassInfo().ClassNamespace;
//		apiNamespace = udtDef.GetGeneratedApiAssemblyInfo().DefaultNamespace;
//	}
//
//	private String GetNameSpace(String baseNameSpace)
//	{
//		String nameSpace = "%1$s.{1}";
//		return String.format(nameSpace, baseNameSpace, GetNameSpaceSuffix());
//	}
//
//	protected abstract String GetNameSpaceSuffix();
//	/**
//	 获取当前构件名称
//
//	 @return
//	*/
//	public final String GetCompName()
//	{
//		if (DotNetToJavaStringHelper.isNullOrEmpty(Operation.ComponentId))
//		{
//			return GetInitializeCompName();
//		}
//		GspMetadata metadata = LcmDtService.GetRefMetadata(Operation.ComponentId);
//		if (metadata == null)
//		{
//			throw new RuntimeException("没有生成构件，无法继续生成代码");
//		}
//
//		IMetadataContent content = metadata.Content;
//		String fullClassName = "";
//		if (content instanceof GspComponent)
//		{
//			GspComponent component = (GspComponent)((metadata.Content instanceof GspComponent) ? metadata.Content : null);
//			fullClassName = component.GetMethod().ClassName;
//		}
//		else
//		{
//			throw new RuntimeException("当前元数据不属于构件元数据");
//		}
//
//		String[] sections = fullClassName.split("[.]", -1);
//		return sections[sections.length - 1];
//	}
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//		///#endregion
//
//	/**
//	 是否执行GenerateCommon()
//
//	*/
//	 boolean getIsCommonGenerate()
//
//	public final String GenerateExecute()
//	{
//		StringBuilder result = new StringBuilder();
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region using
//		GenerateUsing(result);
//		result.append("\n");
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region NameSpaceStart命名空间开始
//
//		result.append(CompCodeNames.KeywordNameSpace).Append(" ").AppendLine(NameSpace);
//		result.AppendLine("{");
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region ClassStart
//
//		result.append(GetIndentationStr()).Append(CompCodeNames.KeywordPublic).Append(" ").Append(CompCodeNames.KeywordClass).Append(" ").Append(GetCompName()).Append(" : ").AppendLine(getBaseClassName());
//		result.append(GetIndentationStr()).AppendLine("{");
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region Field
//
//		GenerateField(result);
//		result.append("\n");
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region Constructor
//
//		GenerateConstructor(result);
//		result.append("\n");
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region ExecuteMethod
//
//		result.append(GetDoubleIndentationStr()).Append(CompCodeNames.KeywordProtected).Append(" ").Append(CompCodeNames.KeywordOverride).Append(" ").Append(CompCodeNames.KeywordVoid).Append(" ").AppendLine("Execute()");
//		result.append(GetDoubleIndentationStr()).AppendLine("{");
//		result.append(GetDoubleIndentationStr()).AppendLine("}");
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region ExtendMethod
//
//		GenerateExtendMethod(result);
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region ClassEnd
//		result.append(GetIndentationStr()).AppendLine("}");
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#region NameSpaceEnd 命名空间结束
//		result.AppendLine("}");
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//			///#endregion
//
//		return result.toString();
//	}
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//		///#region 生成方法
//	/**
//	 生成Using代码
//
//	 @param result
//	*/
//	private void GenerateUsing(StringBuilder result)
//	{
//		result.append(GetUsingStr(entityNamespace));
//		result.append(GetUsingStr(apiNamespace));
//		GenerateExtendUsing(result);
//	}
//	protected abstract void GenerateExtendUsing(StringBuilder result);
//	protected abstract void GenerateConstructor(StringBuilder result);
//	protected void GenerateExtendMethod(StringBuilder result)
//	{
//
//	}
//	protected void GenerateField(StringBuilder result)
//	{
//
//	}
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//		///#endregion
//
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//		///#region 通用方法
//
//	protected final String GetUsingStr(String value)
//	{
//		return new StringBuilder(CompCodeNames.KeywordUsing).Append(" ").Append(value).AppendLine(";").toString();
//	}
//
//	protected final String GetNewline()
//	{
//		return "\r\n";
//	}
//	/**
//	 缩进
//
//	 @return
//	*/
//	protected final String GetIndentationStr()
//	{
//		return "\t";
//	}
//	/**
//	 双缩进
//
//	 @return
//	*/
//	protected final String GetDoubleIndentationStr()
//	{
//		return "\t\t";
//	}
////C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//		///#endregion
//
//	protected abstract String GetInitializeCompName();
//
//	/**
//	 2019.3新加，不需要兼容
//
//	 @return
//	*/
//	public final String GenerateCommon()
//	{
//		return "";
//	}
//}